From 221bac1943483d40500379d3b049552fd4314e66 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 26 May 2010 08:15:31 +0100 Subject: [PATCH] tools: Fix time offset when localtime=0 localtime can be stored in vm config as a string, resulting in incorrect calculation of rtc_timeoffset. Cast localtime to int to ensure rtc_timeoffset is calculated properly. Signed-off-by: Jim Fehlig --- tools/python/xen/xend/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/python/xen/xend/image.py b/tools/python/xen/xend/image.py index cb5f6350e6..144f4f846a 100644 --- a/tools/python/xen/xend/image.py +++ b/tools/python/xen/xend/image.py @@ -129,7 +129,7 @@ class ImageHandler: self.dmargs = self.parseDeviceModelArgs(vmConfig) self.pid = None rtc_timeoffset = int(vmConfig['platform'].get('rtc_timeoffset', 0)) - if vmConfig['platform'].get('localtime', 0): + if int(vmConfig['platform'].get('localtime', 0)): if time.localtime(time.time())[8]: rtc_timeoffset -= time.altzone else: -- 2.30.2